import traceback

from flask import Blueprint, request, g, make_response
from flask_restful import Resource, Api, reqparse, marshal, fields, current_app
from sqlalchemy import or_, and_, not_

from common.models import rds, db, cache
from common.models.information import User, Channel, UserChannel, News, Collection, Comment
from common.utils.login_util import login_required
from common.utils.custom_output_json import custom_output_json
from common.model_fields.channel_fields import user_channel_fields, channel_fields

channel_bp = Blueprint('channel_bp', __name__)
api = Api(channel_bp)


@api.representation('application/json')
def output_json(data, code=200, headers=None):
    return custom_output_json(data, code, headers)


